xyster.net » galleroo » readme

Galleroo

intermediate tinkering

The Digum stylesheet

So you have played with Galleroo a little bit and though you like the existing gallery styles you want to come up with your own customized galleries specifically tailored to your needs. You gave advanced tinkering a gander and got lost in the chatter about XML and XSL and DTDs and other arcana but know your way around HTML. If this is the case, the Digum XSL stylesheet is just what you are looking for. Unlike the other stylesheets, the Digum stylesheet does not directly define the layout of your gallery. Instead, it uses an HTML template embedded with special markup to create the gallery. You can now create your own layout using your favorite HTML editor and then insert Digum stylesheet markup to tell Galleroo where to put images, thumbnails and more.

The Digum stylesheet comes bundled with example templates. Examine the examples to further understand how to use the Digum stylesheet. You will find the example templates in styles/digum/templates in the Galleroo installation folder.

A Digum template

A Digum template is a folder that contains two HTML files with Digum markup and optionally a resource folder. One HTML file, named 'index.html', is the index page template - where thumbs are traditionally displayed. The second HTML file, named 'slide.html', is the slide page template - where the full images (or slides) are traditionally displayed. The resources folder, named 'resources', may contain additional files you would like copied to the gallery folder. Resources can be images, HTML files or any other file type you wish.

HTML format

The Digum stylesheet uses the XSL processer to process the HTML template files. This places a restriction on the format of the HTML template files - they must be valid XML documents. To make your average HTML document a valid XML document (not necessarily a valid XHTML document!) you must adhere to two simple rules:

Digum Markup

Digum markup always starts with the three letters 'gal' and when used in attributes is always contained within braces, {}. Most Digum markup can be used either in attributes or as elements. A few of them can only be used as elements. All Digum markup except the 'gal-index' tag is evaluated in relation to two cursors, one is the image cursor and the second is the index cursor. When processing a slide template, the image cursor is positioned on the slide image while the index cursor is positioned on the slide's parent index. When processing an index template, the image cursor is positioned on the index's first child image while the index cursor is positioned on the current index. Cursors can be offset either forward or backwards using offset attributes in the markup. The image offset attribute is 'io' while the index offset attribute is 'jo'.

An example of typical Digum markup usage is:

<gal-if-index-valid jo="-1">
<img src="previous.gif" alt="Previous Index" />
</gal-if-index-valid>

<gal-if-image-valid io="+1">
<img src="{gal-image-thumb-src}" width="{gal-image-thumb-x-size}" height="{gal-image-thumb-y-size}" alt="{gal-image-title}" />
</gal-if-image-valid>

 

Reference

Reference
Tag Description Example Applicable Cursors (io, jo, both, N/A) Where can be used (element, attribute, both)
gal-gallery-generator
Outputs Galleroo version.
<gal-gallery-generator /> 
N/A Both
gal-gallery-*

Outputs the value of the parameter as it is set in the Galleroo user interface.

 

<gal-gallery-title />
<gal-gallery-sub-title />
<gal-gallery-source-folder />
<gal-gallery-gallery-folder />
<gal-gallery-sort-by />
<gal-gallery-image-size />
<gal-gallery-thumb-size />
<gal-gallery-do-auto-play-movies />
<gal-gallery-html-file-prefix />
<gal-gallery-template-folder />
N/A Both
gal-gallery-if-*
Conditionally places markup contained within the element in the created page if the value of the gallery parameter is equal to the contents of the value attribute.
<gal-gallery-if-title value="hello">
The title of this gallery says hello
</gal-gallery-if-title>

N/A Element only
gal-gallery-if-not-*
Conditionally places markup contained within the element in the created page if the value of the gallery parameter not equal to the contents of the value attribute.
<gal-gallery-if-not-title value="goodbye"> 
The title of this gallery does not say goodbye 
</gal-gallery-if-not-title>
N/A Element only
gal-offset
Offsets the index cursor and/or the image cursor for all markup contained within the element.
<gal-index-num /> <!-- A -->
<gal-image-num /> <!-- B -->

<gal-offset jo="4" io="-12">

<gal-index-num /> <!-- A + 4 -->
<gal-image-num /> <!-- B - 12 -->

</gal-offset>
io, jo Element only
gal-index
May optionally be placed in the index template, immediately within the <html> tag, with the io attribute to override automatic thumbnail counting and to specify the number of thumbnails each index is meant to have in it. In most cases, you do not need to use this element.
<html>
<!-- there are 15 thumbnails in this index 
  -->
<gal-index io="15" />
<head>
<title>hello</title>

</head>
<body>
...
</body>

</html>
N/A Element only
gal-index-num
The index position.
<gal-index-num /> 
jo Both
gal-index-max
Number of indices in the gallery. <gal-index-max /> N/A Both
gal-index-href
The index page's relative URL

<a href="{gal-index-href}"><gal-index-href /></a>

jo Both
gal-if-index-valid
Conditionally places markup contained within the element in the created page if the index exists. Is always specified with the jo attribute since, by definition, the current index always exists. The cursor is repositioned at the tested position for markup contained within.
<gal-if-index-valid jo="4">

<a href="{gal-index-href}">4 indices away</a>

</gal-if-index-valid>
jo Element only
gal-if-index-not-valid
Conditionally places markup contained within the element in the created page if the index does not exist. Is always specified with the jo attribute since, by definition, the current index always exists. The cursor is repositioned at the tested position for markup contained within.
<gal-if-index-not-valid jo="4">
There are less than 4 more index pages 
which means their are less than 
<gal-index-num /> pages
</gal-if-index-not-valid>
jo Element only
gal-image-num
The image position.
<gal-image-num />
io Both
gal-image-max
Number of images in the gallery.
<gal-image-max />
N/A Both
gal-image-*

Outputs the value of the image attribute specified.

Attributes:

  • title
  • comment
  • pretty-name
  • full-href
  • thumb-src
  • thumb-x-size
  • thumb-y-size
  • full-src
  • full-x-size
  • full-y-size
  • camera-make
  • camera-model
  • ccd-width
  • date
  • exif-version
  • exposure-time
  • f-stop
  • file-size
  • flash-used
  • format
  • full-path
  • is-color
  • name
  • path
  • thumb-name
  • thumb-path
  • user-caption
  • user-comment
  • user-title
  • x-resolution
  • x-size
  • y-resolution
  • y-size
  • iptc-title
  • iptc-urgency
  • iptc-categories
  • iptc-keywords
  • iptc-instructions
  • iptc-date
  • iptc-author
  • iptc-author-position
  • iptc-city
  • iptc-state
  • iptc-country-code
  • iptc-country
  • iptc-trans-ref
  • iptc-headline
  • iptc-credit
  • iptc-source
  • iptc-copyright
  • iptc-caption
  • iptc-caption-author

 

<gal-image-title />
<gal-image-comment />
<gal-image-pretty-name />
<!-- thumbnail link -->
<a href="gal-image-full-href">
<img src="{gal-image-thumb-src}" 
     width="{gal-image-thumb-x-size}"
	 height="{gal-image-thumb-y-size}" 
     alt="{gal-image-title}" />
</a>
<!-- full slide image -->
<img src="{gal-image-full-src}"
     width="{gal-image-full-x-size}"
	 height="{gal-image-full-y-size}" 
     alt="{gal-image-title}" />


This picture was taken with a
<gal-image-camera-model /> made by
<gal-image-camera-make />
io Both
gal-image-if-*
Conditionally places markup contained within the element in the created page if the value of the image attribute is equal to the contents of the value attribute or if the exists attribute evaluates to true.
<gal-image-if-is-color value="1">
This picture is in color!
</gal-image-if-is-color>

<gal-image-if-is-color exists="1">
The is-color attribute exists!
</gal-image-if-is-color>
io Element only
gal-image-if-not-*
Conditionally places markup contained within the element in the created page if the value of the image attribute is not equal to the contents of the value attribute or if the exists attribute evaluates to false..
<gal-image-if-not-flash-used value="1">
This picture was not taken with a flash
</gal-image-if-not-flash-used>


<gal-image-if-not-flash-used exists="1">
I don't know if a flash was used or not!
</gal-image-if-not-flash-used>
io Element only
gal-image-full
Outputs the slide image with one command. <gal-image-full io="1" /> io Element only
gal-if-image-valid
Conditionally places markup contained within the element in the created page if the image exists. Is always specified with the io attribute since, by definition, the current image always exists. The cursor is repositioned at the tested position for markup contained within.
<gal-if-image-valid io="3">
There are at least 3 more images after this 
one
</gal-if-image-valid>
io Element only
gal-if-image-not-valid
Conditionally places markup contained within the element in the created page if the image does not exist. Is always specified with the io attribute since, by definition, the current image always exists. The cursor is repositioned at the tested position for markup contained within.
<gal-if-image-not-valid io="3">
There are less than 3 images after this one
</gal-if-image-not-valid>
io Element only
gal-eval
Evaluate Digum markup given in the expr attribute and output into the page being created. In most cases this is no necessary since you can write the markup as an element directly.
<gal-eval expr="{gal-image-title}" />
io, jo Element only
gal-xpath
Evaluate and output result of XSL expression given in xpath attribute.
<gal-xpath xpath="14 + 45" />
N/A Element only
gal-if-xpath
Conditionally places markup contained within the element in the created page if the XSL test given in the test attribute evaluates to true.
<gal-if-xpath test="$title = 'hello'">

</gal-if-xpath>
io, jo Element only

Reporting bugs, questions and comments

If you find any bugs or have questions, comments or requests, you can contact the author through this email link

 


xyster.net

home | galleroo | lister | hebrish | junk | personal | aboo